(window.webpackJsonp = window.webpackJsonp || []).push([
  [1006],
  {
    10485: function (e, t, n) {
      "use strict";
      n.d(t, "c", function () {
        return i;
      }),
        n.d(t, "b", function () {
          return o;
        }),
        n.d(t, "a", function () {
          return a;
        }),
        n.d(t, "d", function () {
          return s;
        }),
        n.d(t, "e", function () {
          return r;
        });
      var i = 0,
        o = 1,
        a = 2,
        s = 3,
        r = 4;
    },
    12643: function (e, t, n) {
      "use strict";
      n.r(t);
      var i = n(12),
        o = n.n(i),
        a = n(62),
        s = n.n(a),
        r = n(1),
        l = n.n(r),
        c = n(2),
        h = n.n(c),
        d = n(281),
        p = n(1709),
        u = n(28),
        g = n(5093),
        f = n(1520),
        C = n(1476),
        v = n(660),
        _ = n(290),
        x = n(811),
        T = n(1186),
        b = n(5094),
        m = n(1621),
        y = n(5790),
        k = n(1373),
        P = n(6801),
        w = n(6425),
        S = n(7196),
        I = n(972),
        E = n(1338),
        F = n(530),
        R = n(1196),
        N = n(315),
        A = n(2767),
        L = {
          CC_Ascii: 0,
          CC_FarEast: 1,
          CC_NoFarEast: 2,
          CC_Shared: 3,
          CC_Complex: 4,
        },
        D = 5,
        M = 6,
        O = [
          { chTo: 127, nClass: L.CC_Ascii },
          { chTo: 255, nClass: D },
          { chTo: 383, nClass: D },
          { chTo: 591, nClass: D },
          { chTo: 687, nClass: D },
          { chTo: 767, nClass: L.CC_Shared },
          { chTo: 879, nClass: L.CC_Shared },
          { chTo: 975, nClass: L.CC_Shared },
          { chTo: 1023, nClass: L.CC_NoFarEast },
          { chTo: 1279, nClass: L.CC_Shared },
          { chTo: 1327, nClass: L.CC_NoFarEast },
          { chTo: 1423, nClass: L.CC_NoFarEast },
          { chTo: 1487, nClass: L.CC_Complex },
          { chTo: 1535, nClass: L.CC_Complex },
          { chTo: 1618, nClass: L.CC_Complex },
          { chTo: 1791, nClass: L.CC_Complex },
          { chTo: 1871, nClass: L.CC_Complex },
          { chTo: 1983, nClass: L.CC_Complex },
          { chTo: 2431, nClass: L.CC_Complex },
          { chTo: 2559, nClass: L.CC_Complex },
          { chTo: 2687, nClass: L.CC_Complex },
          { chTo: 2815, nClass: L.CC_Complex },
          { chTo: 2943, nClass: L.CC_Complex },
          { chTo: 3071, nClass: L.CC_Complex },
          { chTo: 3199, nClass: L.CC_Complex },
          { chTo: 3327, nClass: L.CC_Complex },
          { chTo: 3455, nClass: L.CC_Complex },
          { chTo: 3711, nClass: L.CC_Complex },
          { chTo: 3839, nClass: L.CC_Complex },
          { chTo: 4095, nClass: L.CC_Complex },
          { chTo: 4255, nClass: L.CC_NoFarEast },
          { chTo: 4303, nClass: L.CC_NoFarEast },
          { chTo: 4351, nClass: L.CC_NoFarEast },
          { chTo: 4607, nClass: L.CC_NoFarEast },
          { chTo: 4991, nClass: L.CC_NoFarEast },
          { chTo: 5119, nClass: L.CC_NoFarEast },
          { chTo: 5759, nClass: L.CC_NoFarEast },
          { chTo: 5791, nClass: L.CC_NoFarEast },
          { chTo: 5887, nClass: L.CC_NoFarEast },
          { chTo: 5919, nClass: L.CC_NoFarEast },
          { chTo: 5951, nClass: L.CC_NoFarEast },
          { chTo: 5983, nClass: L.CC_Complex },
          { chTo: 6015, nClass: L.CC_Complex },
          { chTo: 6143, nClass: L.CC_Complex },
          { chTo: 6319, nClass: L.CC_Complex },
          { chTo: 7935, nClass: L.CC_Shared },
          { chTo: 8191, nClass: L.CC_NoFarEast },
          { chTo: 8303, nClass: L.CC_Shared },
          { chTo: 8351, nClass: L.CC_Shared },
          { chTo: 8399, nClass: L.CC_Shared },
          { chTo: 8447, nClass: L.CC_Shared },
          { chTo: 8527, nClass: L.CC_Shared },
          { chTo: 8591, nClass: L.CC_Shared },
          { chTo: 8703, nClass: L.CC_Shared },
          { chTo: 8959, nClass: L.CC_Shared },
          { chTo: 9215, nClass: L.CC_Shared },
          { chTo: 9279, nClass: L.CC_Shared },
          { chTo: 9311, nClass: L.CC_Shared },
          { chTo: 9471, nClass: L.CC_Shared },
          { chTo: 9599, nClass: L.CC_Shared },
          { chTo: 9631, nClass: L.CC_Shared },
          { chTo: 9727, nClass: L.CC_Shared },
          { chTo: 9983, nClass: L.CC_Shared },
          { chTo: 10175, nClass: L.CC_Shared },
          { chTo: 10223, nClass: L.CC_Shared },
          { chTo: 10239, nClass: L.CC_Shared },
          { chTo: 10495, nClass: L.CC_Shared },
          { chTo: 10623, nClass: L.CC_Shared },
          { chTo: 10751, nClass: L.CC_Shared },
          { chTo: 11007, nClass: L.CC_Shared },
          { chTo: 12031, nClass: L.CC_FarEast },
          { chTo: 12255, nClass: L.CC_FarEast },
          { chTo: 12287, nClass: L.CC_FarEast },
          { chTo: 12351, nClass: L.CC_FarEast },
          { chTo: 12447, nClass: L.CC_FarEast },
          { chTo: 12543, nClass: L.CC_FarEast },
          { chTo: 12591, nClass: L.CC_FarEast },
          { chTo: 12687, nClass: L.CC_FarEast },
          { chTo: 12703, nClass: L.CC_FarEast },
          { chTo: 12735, nClass: M },
          { chTo: 12799, nClass: M },
          { chTo: 13055, nClass: L.CC_FarEast },
          { chTo: 13311, nClass: L.CC_FarEast },
          { chTo: 19903, nClass: L.CC_FarEast },
          { chTo: 40959, nClass: L.CC_FarEast },
          { chTo: 42127, nClass: M },
          { chTo: 42191, nClass: M },
          { chTo: 55203, nClass: L.CC_FarEast },
          { chTo: 56191, nClass: L.CC_FarEast },
          { chTo: 56319, nClass: L.CC_FarEast },
          { chTo: 57343, nClass: L.CC_FarEast },
          { chTo: 63743, nClass: L.CC_Shared },
          { chTo: 64255, nClass: L.CC_FarEast },
          { chTo: 64335, nClass: L.CC_Shared },
          { chTo: 65023, nClass: L.CC_Shared },
          { chTo: 65039, nClass: M },
          { chTo: 65071, nClass: L.CC_FarEast },
          { chTo: 65103, nClass: L.CC_FarEast },
          { chTo: 65135, nClass: L.CC_FarEast },
          { chTo: 65278, nClass: L.CC_Shared },
          { chTo: 65519, nClass: L.CC_FarEast },
          { chTo: 65535, nClass: L.CC_NoFarEast },
          { chTo: 65663, nClass: L.CC_NoFarEast },
          { chTo: 65791, nClass: L.CC_NoFarEast },
          { chTo: 65855, nClass: L.CC_NoFarEast },
          { chTo: 65935, nClass: L.CC_NoFarEast },
          { chTo: 66303, nClass: M },
          { chTo: 66351, nClass: L.CC_NoFarEast },
          { chTo: 66383, nClass: L.CC_NoFarEast },
          { chTo: 66431, nClass: M },
          { chTo: 66463, nClass: L.CC_NoFarEast },
          { chTo: 66527, nClass: L.CC_NoFarEast },
          { chTo: 66559, nClass: M },
          { chTo: 66639, nClass: L.CC_NoFarEast },
          { chTo: 66687, nClass: L.CC_NoFarEast },
          { chTo: 66735, nClass: L.CC_NoFarEast },
          { chTo: 67583, nClass: M },
          { chTo: 67647, nClass: L.CC_NoFarEast },
          { chTo: 67839, nClass: M },
          { chTo: 67871, nClass: L.CC_NoFarEast },
          { chTo: 68095, nClass: M },
          { chTo: 68191, nClass: L.CC_NoFarEast },
          { chTo: 73727, nClass: M },
          { chTo: 73983, nClass: L.CC_NoFarEast },
          { chTo: 74751, nClass: M },
          { chTo: 74879, nClass: L.CC_NoFarEast },
          { chTo: 118783, nClass: M },
          { chTo: 119039, nClass: L.CC_NoFarEast },
          { chTo: 119295, nClass: L.CC_NoFarEast },
          { chTo: 119375, nClass: L.CC_NoFarEast },
          { chTo: 119551, nClass: M },
          { chTo: 119647, nClass: L.CC_FarEast },
          { chTo: 119679, nClass: L.CC_FarEast },
          { chTo: 119807, nClass: M },
          { chTo: 120831, nClass: L.CC_NoFarEast },
          { chTo: 131071, nClass: M },
          { chTo: 173791, nClass: L.CC_FarEast },
          { chTo: 194559, nClass: M },
          { chTo: 195103, nClass: L.CC_FarEast },
          { chTo: 917503, nClass: M },
          { chTo: 917631, nClass: L.CC_NoFarEast },
          { chTo: 983039, nClass: M },
          { chTo: 1048573, nClass: L.CC_NoFarEast },
          { chTo: 1114109, nClass: L.CC_NoFarEast },
        ],
        U = [
          2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
          2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 3, 2, 2, 3, 3, 2, 3, 2, 2, 3,
          2, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 2, 2, 2, 2,
          2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2,
          2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
          2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2,
          2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2,
          2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
          2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 2, 3, 2,
          2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
          2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
          2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2,
          2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
          2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
          2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
          2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
          2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2,
          2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
          2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
          2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
          2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2,
          2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
          2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
          2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
          2, 2, 2, 2, 2, 2, 2, 2,
        ];
      function B(e) {
        return e >= 55296 && e <= 56191;
      }
      function H(e) {
        return e >= 56320 && e <= 57343;
      }
      function V(e, t) {
        return B(e) && H(t) ? 65536 + (((e - 55296) << 10) | (t - 56320)) : 0;
      }
      function W(e) {
        var t = (function (e) {
          var t =
              arguments.length > 1 && void 0 !== arguments[1]
                ? arguments[1]
                : 0,
            n = 0;
          n = B(t) && H(e) ? V(t, e) : e;
          for (var i = 0; i < O.length && !(O[i].chTo >= n); ++i);
          return i === O.length ? null : O[i];
        })(e);
        if (!t) return L.CC_Ascii;
        if (t.nClass === M) return M;
        if (t.nClass !== D) return t.nClass;
        var n = e - 128;
        return n >= 0 && n < U.length ? U[n] : M;
      }
      var j = n(2195),
        G = "zh-CN" === window.langName,
        z = (function () {
          function e(t) {
            l()(this, e), (this.sel = t);
          }
          return (
            h()(e, [
              {
                key: "_isIgnoredChar",
                value: function (e) {
                  return (
                    e === _.Space ||
                    e === _.EndPara ||
                    e === _.Tab ||
                    e === _.Drawing ||
                    e === _.Embed ||
                    e === _.FullWidthSpace
                  );
                },
              },
              {
                key: "_charFontChooser",
                value: function (e, t, n) {
                  if (e === _.TextSymbol && n.getPropVal("special"))
                    return n.getProp("symbol_fontname");
                  var i = { val: 0 };
                  switch (W(e)) {
                    case L.CC_Ascii:
                      i = n.getProp("font_name_ascii");
                      break;
                    case L.CC_FarEast:
                      i = n.getProp("font_name_asia_east");
                      break;
                    case L.CC_NoFarEast:
                      i = n.getProp("font_name_complex");
                      break;
                    case L.CC_Shared:
                      i = t
                        ? n.getProp("font_name_asia_east")
                        : n.getProp("font_name_complex");
                      break;
                    case L.CC_Complex:
                      i = n.getProp("font_name_ftcbi");
                  }
                  return { ch: e, val: i.val };
                },
              },
              {
                key: "_spanFontChooser",
                value: function (e, t, n) {
                  for (
                    var i = t.getPropVal("share_hint"), o = e.length, a = 0;
                    a < o;
                    ++a
                  )
                    n.push(this._charFontChooser(e.charCodeAt(a), i, t));
                },
              },
              {
                key: "_spansFontChooser",
                value: function (e, t) {
                  for (
                    var n = this.sel.data.doc.getDataLogic("final"),
                      i = n.collectChpxs(e.pos, e.len),
                      o = i.length,
                      a = 0;
                    a < o;
                    ++a
                  ) {
                    var s = i[a].pos,
                      r = i[a].len;
                    if (0 === a && s < e.pos) {
                      if ((r = s + r - e.pos) <= 0) continue;
                      s = e.pos;
                    }
                    if (
                      !(
                        a === o - 1 &&
                        s + r > e.pos + e.len &&
                        (r = e.pos + e.len - s) <= 0
                      )
                    ) {
                      r > 1024 && (r = 1024);
                      var l = n.getText(s, r);
                      this._spanFontChooser(l, i[a].prop, t);
                    }
                  }
                },
              },
              {
                key: "_getAsiaFontName",
                value: function (e) {
                  return e.getPropVal("font_name_asia_east");
                },
              },
              {
                key: "getFontId",
                value: function () {
                  var e = this.sel.selInfo.getSelectionInfo(),
                    t = e.isTextboxSelected
                      ? e.textbox
                      : this.sel.getNormalRange();
                  if (0 === t.len) {
                    var n = this.sel.selInfo.getIpChpx();
                    if (void 0 !== n && void 0 !== n.fontName)
                      return this.sel.data.doc.fonttable.query(n.fontName);
                    var i = this.sel.selInfo.getPointChpx();
                    if (void 0 === i || void 0 === i.prop) return;
                    var o = i.pos;
                    o = t.pos > o ? t.pos - 1 : t.pos;
                    var a = this.sel.data.doc.getText(o, 1);
                    if (void 0 === a || 0 === a.length) return;
                    if (G && a.charCodeAt(0) === _.EndPara)
                      return this._getAsiaFontName(i.prop);
                    var s = i.prop.getPropVal("share_hint");
                    return this._charFontChooser(a.charCodeAt(0), s, i.prop)
                      .val;
                  }
                  for (
                    var r = [],
                      l = e.isTextboxSelected
                        ? [e.textbox]
                        : this.sel.getNormalRanges(),
                      c = l.length,
                      h = 0;
                    h < c;
                    ++h
                  ) {
                    var d = l[h];
                    this._spansFontChooser(d, r);
                  }
                  var p = r.length;
                  if (0 !== p) {
                    for (var u = 0; u < p && r[u].ch === _.Drawing; ++u);
                    u === p && (u = p - 1);
                    var g = [0, 1, 0, 0];
                    (g[0] = this.sel.data.doc.fonttable.getReservedFontFtc(
                      j.ReservedFont.ascii
                    )),
                      (g[1] = this.sel.data.doc.fonttable.getReservedFontFtc(
                        j.ReservedFont.ea
                      )),
                      (g[2] = this.sel.data.doc.fonttable.getReservedFontFtc(
                        j.ReservedFont.cs
                      )),
                      (g[3] = this.sel.data.doc.fonttable.getReservedFontFtc(
                        j.ReservedFont.bi
                      ));
                    for (var f = void 0, C = u; u < p; ++u) {
                      if (
                        (r[u].val < 0 && (r[u].val = g[Math.abs(r[u].val) - 1]),
                        r[u].val !== r[C].val &&
                          !this._isIgnoredChar(r[C].ch) &&
                          !this._isIgnoredChar(r[u].ch))
                      )
                        return;
                      this._isIgnoredChar(r[C].ch) &&
                        !this._isIgnoredChar(r[u].ch) &&
                        (C = u),
                        (f = r[C].val);
                    }
                    return f;
                  }
                },
              },
            ]),
            e
          );
        })(),
        X = n(371),
        q = n(509),
        J = q.DOCUnicodeSubRangeTools.DOCCharTypeFastDetecter,
        K = q.DOCTxUsrType.usrThai,
        Y = ".".charCodeAt(0),
        Z = (function () {
          function e(t) {
            l()(this, e), (this.data = t);
          }
          return (
            h()(e, [
              {
                key: "GetWordCountInRange",
                value: function (e) {
                  if (0 === e.len) return 0;
                  for (
                    var t = 0,
                      n = !1,
                      i = this.data.glyphpool,
                      o = i.glyphBuff,
                      a = i.glyphIterator,
                      s = e.pos,
                      r = s + e.len;
                    s < r;
                    ++s
                  )
                    if (!a.seek(s) || a.glyphGroup.isVisible()) {
                      var l = o.getCharCode(s),
                        c = J.getUnicodeCharItem(l);
                      if (this.isSpecial(l)) n = !1;
                      else if (
                        this.isAsia(c) ||
                        (!this.isCharAlphaNumeric(c, l) &&
                          this.isShareCharCountedWord(c, a.glyphGroup, o, s))
                      )
                        ++t, (n = !1);
                      else if (c.usrType === K && window.APP.thaiDict) {
                        n = !1;
                        for (var h = s + 1; h < r; ) {
                          var d = o.getCharCode(h);
                          if (!((d >= 3584 && d <= 3711) || Y === d)) break;
                          ++h;
                        }
                        var p = o.getText(s, h - s);
                        (t += window.APP.thaiDict.cut(p).length),
                          (s += h - s - 1);
                      } else n || (++t, (n = !0));
                    } else (s = a.glyphGroup.end - 1), (n = !1);
                  return t;
                },
              },
              {
                key: "isSpecial",
                value: function (e) {
                  return !!(
                    X.default.isLineBreak(e) ||
                    X.default.isTab(e) ||
                    X.default.isNormalSpace(e) ||
                    X.default.isFullWidthSpace(e) ||
                    X.default.isNonBreakSpace(e) ||
                    X.default.isComment(e) ||
                    X.default.isFootnote(e) ||
                    X.default.isDrawing(e) ||
                    X.default.isEmbedDrawing(e)
                  );
                },
              },
              {
                key: "isAsia",
                value: function (e) {
                  return e.charClass === q.DOCTxCharClass.CC_FarEast;
                },
              },
              {
                key: "isShared",
                value: function (e) {
                  return e.charClass === q.DOCTxCharClass.CC_Shared;
                },
              },
              {
                key: "isShareCharCountedWord",
                value: function (e, t, n, i) {
                  if (this.isShared(e) && t.isCJKFont()) {
                    if (i > 0 && i == t.begin) {
                      var o = n.getCharCode(i - 1),
                        a = J.getUnicodeCharItem(o),
                        s = t.getPrevNode();
                      if (this.isShared(a) && !s.isCJKFont()) return !1;
                    }
                    return !0;
                  }
                  return !1;
                },
              },
              {
                key: "isCharAlphaNumeric",
                value: function (e, t) {
                  return X.default.isAlpha(t) || X.default.isNum(t);
                },
              },
            ]),
            e
          );
        })(),
        Q = n(1176),
        $ = n(3586),
        ee = n(10485),
        te = n(280),
        ne = n(635),
        ie = n(1413),
        oe = n(3588),
        ae = (function () {
          function e(t) {
            var n = this;
            l()(this, e),
              (this.getTextFlow = function () {
                var e =
                    n.data.selection.begin.pos &&
                    n.data.selection.begin.pos.line,
                  t = e && (e.isSubLine ? e.parent.parent : e.parent),
                  i = t && t.textflow,
                  o = n.getTextboxInfo();
                if (!o || !o.isTextboxSelected) return i;
              }),
              (this.selection = t),
              (this.data = t.data),
              (this.wordStat = new Z(this.data)),
              (this._info = null);
          }
          return (
            h()(e, [
              {
                key: "getTextboxInfo",
                value: function () {
                  var e = this.selection,
                    t = e.begin,
                    n = e.end,
                    i = this.data.doc.textboxs.findBodyRange(t.position);
                  return {
                    textbox: i,
                    isTextboxSelected: !!i && n.position - t.position == 1,
                  };
                },
              },
              {
                key: "getTextboxChpx",
                value: function (e) {
                  var t = void 0;
                  return (
                    this.data.doc
                      .getDataLogic("final")
                      .collectChpxs(e.pos, e.len)
                      .forEach(function (e) {
                        var n = e.prop;
                        void 0 === t ? (t = n) : t.intersect(n);
                      }),
                    t
                  );
                },
              },
              {
                key: "getTextboxPapx",
                value: function (e) {
                  var t = void 0;
                  return (
                    this.data.doc
                      .getDataLogic("final")
                      .collectPapxs(e.pos, e.len)
                      .forEach(function (e) {
                        var n = e.prop;
                        void 0 === t
                          ? (t = n)
                          : n.para_type !== C.d && t.intersect(n);
                      }),
                    t
                  );
                },
              },
              {
                key: "adjustMathPapx",
                value: function (e) {
                  var t = e.pos,
                    n = e.len,
                    i = e.prop,
                    o = this.data.doc.mathManager.getMath(t, !0);
                  if (o && o.pos === t && (o.len === n || o.len === n - 1)) {
                    var a = o.getData().getJc(),
                      s = i.horizontal_align_mode;
                    switch (a) {
                      case ee.c:
                      case ee.b:
                        s = m.Adjustify;
                        break;
                      case ee.d:
                        s = m.Left;
                        break;
                      case ee.e:
                        s = m.Right;
                        break;
                      case ee.a:
                        s = m.Center;
                        break;
                      default:
                        console.assert(!1);
                    }
                    i.horizontal_align_mode = s;
                  }
                },
              },
              {
                key: "getMathChpx",
                value: function () {
                  if (this.selection.inOMath) {
                    var e = this.selection.begin.position,
                      t = this.data.doc.mathManager.getMath(e);
                    if (t) {
                      var n = this.data.doc.getDataLogic("final");
                      return this.selection.begin.position === t.pos
                        ? n.getChpx(e)
                        : void 0;
                    }
                  }
                },
              },
              {
                key: "getReplaceChpx",
                value: function () {
                  var e = this.data.doc.getDataLogic("final"),
                    t = this.selection.getNormalRange();
                  return 0 !== t.len || e.atPapxBound(t.pos)
                    ? e.getChpx(t.pos).prop
                    : e.getChpx(t.pos, d.IT.Exclude).prop;
                },
              },
              {
                key: "getPointChpx",
                value: function () {
                  var e = this.data.doc.getDataLogic("final"),
                    t = this.selection.getNormalRange(),
                    n = void 0;
                  return (n = this.getMathChpx())
                    ? n
                    : (n = e.atPapxBound(t.pos)
                        ? e.getChpx(t.pos)
                        : e.getChpx(t.pos, d.IT.Exclude));
                },
              },
              {
                key: "getIpChpx",
                value: function () {
                  return this.selection.selContext.ipChpx;
                },
              },
              {
                key: "getChpx",
                value: function () {
                  var e = this.selection.selContext,
                    t = this.getTextboxInfo();
                  if (t.isTextboxSelected)
                    return this.getTextboxChpx(t.textbox);
                  if (void 0 !== e.chpx) {
                    if (void 0 !== e.ipChpx) {
                      var n = Object(g.h)(e.ipChpx, this.data.doc);
                      e.chpx.setProps(n);
                    }
                    return e.chpx;
                  }
                  var i = this.selection.getNormalRanges(),
                    o = i.length;
                  if (!(o <= 0)) {
                    var a = void 0;
                    if (1 === o && 0 === i[0].len) {
                      var s = this.getPointChpx();
                      if (void 0 === s) return;
                      a = s.prop;
                    } else {
                      var r = this.data.doc.getDataLogic("final");
                      i.forEach(function (e) {
                        r.collectChpxs(e.pos, e.len).forEach(function (e) {
                          var t = e.prop;
                          void 0 === a ? (a = t) : a.intersect(t);
                        });
                      });
                    }
                    if (void 0 !== a) {
                      if (((e.chpx = a), void 0 !== e.ipChpx)) {
                        var l = Object(g.h)(e.ipChpx, this.data.doc);
                        e.chpx.setProps(l);
                      }
                      return e.chpx;
                    }
                  }
                },
              },
              {
                key: "getPapx",
                value: function () {
                  var e = this,
                    t = this.selection.selContext,
                    n = this.getSelectionInfo();
                  if (n.isTextboxSelected)
                    return this.getTextboxPapx(n.textbox);
                  if (void 0 !== t.papx) return t.papx;
                  var i = this.data.doc.getDataLogic("final"),
                    o = this.selection.getNormalRanges(),
                    a = void 0;
                  return (
                    o.forEach(function (t) {
                      i.collectPapxs(t.pos, t.len).forEach(function (t) {
                        var n = t.prop;
                        if ((e.adjustMathPapx(t), void 0 === a)) a = n;
                        else {
                          if (n.para_type === C.d) return;
                          a.intersect(n);
                        }
                      });
                    }),
                    void 0 !== a ? ((t.papx = a), t.papx) : void 0
                  );
                },
              },
              {
                key: "getText",
                value: function () {
                  for (
                    var e = this.selection.getNormalRanges(),
                      t = e.length,
                      n = "",
                      i = 0;
                    i < t;
                    ++i
                  ) {
                    var o = e[i];
                    o.len <= 0 || (n += this.data.doc.getText(o.pos, o.len));
                  }
                  return n;
                },
              },
              {
                key: "getDisplayText",
                value: function () {
                  var e =
                      arguments.length > 0 && void 0 !== arguments[0]
                        ? arguments[0]
                        : void 0,
                    t = this.selection.getActiveAreaNormalRanges(),
                    n = t[0];
                  n.pos > t[t.length - 1].pos && (n = t[t.length - 1]);
                  var i = this.data.doc.getText(n.pos, n.len);
                  if (void 0 === i) return "";
                  for (var o = 0; o < i.length; ++o) {
                    var a = i.charCodeAt(o);
                    if (Object(x.isSpecialPlaceholder)(a))
                      return (
                        e && (e.hasSpecialHolder = !0),
                        _i18n(
                          "applications.writer.components.core.shell.model.selection.selection.chose",
                          "<<在文档中选定的内容>>"
                        )
                      );
                  }
                  var s = this.data.doc.fields.getFields({
                    begin: n.pos,
                    end: n.pos + n.len,
                  });
                  if (0 !== s.length) {
                    for (var r = "", l = [], c = 0; c < i.length; ++c)
                      i.charCodeAt(c) === _.FieldBegin
                        ? l.push(!0)
                        : i.charCodeAt(c) === _.FieldSep
                        ? (l[l.length - 1] = !1)
                        : i.charCodeAt(c) === _.FieldEnd
                        ? l.pop()
                        : (0 === l.length || (1 === l.length && !l[0])) &&
                          (r += i[c]);
                    return r;
                  }
                  return i;
                },
              },
              {
                key: "getStyle",
                value: function () {
                  var e = this.getChpx();
                  if (void 0 !== e && void 0 !== e.basestyle) {
                    if (e.basestyle.id === f.o) return f.o;
                    var t = this.data.doc.stylesheet.findStyle(
                      e.basestyle.id,
                      e.basestyle.name
                    );
                    if (void 0 !== t && void 0 !== t.linkStyle)
                      return t.linkStyle.id;
                  }
                  var n = this.getPapx();
                  if (void 0 !== n && void 0 !== n.basestyle)
                    return n.basestyle.id;
                },
              },
              {
                key: "getSeparator",
                value: function () {
                  var e = this.selection.getNormalRange(),
                    t = this.data.doc.getDataLogic("final"),
                    n = t.getPapx(e.pos);
                  if (0 === e.len && n.pos + n.len - 1 === e.pos) {
                    var i = void 0,
                      o = this.data.doc.getMainTextLength();
                    if (
                      (n.pos + n.len !== o && (i = t.getPapx(n.pos + n.len)), n)
                    ) {
                      var a = n.prop.border_bottom;
                      if (
                        a &&
                        a.styleType &&
                        a.style &&
                        a.style !== T.LineStyle_None
                      )
                        return (
                          (a.hexColor = new Q.default(a.color).color),
                          { pos: e.pos, borderType: b.BorderBottom, border: a }
                        );
                    }
                    if (i) {
                      var s = i.prop && i.prop.border_top;
                      if (
                        s &&
                        s.styleType &&
                        s.style &&
                        s.style !== T.LineStyle_None
                      )
                        return (
                          (s.hexColor = new Q.default(s.color).color),
                          {
                            pos: n.pos + n.len,
                            borderType: b.BorderTop,
                            border: s,
                          }
                        );
                    }
                  }
                },
              },
              {
                key: "getMaxMargin",
                value: function (e) {
                  var t = this.selection.getNormalRange(),
                    n = { left: 1584, right: 1584, top: 1584, bottom: 1584 },
                    i = this.data.doc.sections.rangeClass.collectRanges(
                      t.pos,
                      t.len
                    ),
                    o = this.data.doc.sections.getSection(t.pos + t.len);
                  void 0 !== o &&
                    (0 === i.length ||
                      i[i.length - 1].pos + i[i.length - 1].len !==
                        t.pos + t.len) &&
                    i.push(o);
                  for (var a = 0; a < i.length; ++a)
                    if (
                      void 0 !== i[a].data &&
                      void 0 !== i[a].data.private &&
                      void 0 !== i[a].data.private.props
                    ) {
                      var s = 0,
                        r = 0;
                      if (i[a].data.private.props.genko.enable) {
                        if (
                          ((s = i[a].data.private.props.genko.pageHeight),
                          (r = i[a].data.private.props.genko.pageWidth),
                          void 0 === s || void 0 === r)
                        )
                          continue;
                      } else if (
                        ((s = i[a].data.private.props.page.height),
                        (r = i[a].data.private.props.page.width),
                        void 0 === s || void 0 === r)
                      )
                        continue;
                      var l = i[a].data.private.props.page.gutterMargin,
                        c = i[a].data.private.props.page.rtlGutter,
                        h = i[a].data.private.props.multiplePages;
                      (3 !== h && 4 !== h) ||
                        (i[a].data.private.props.page.orientation
                          ? (r *= 2)
                          : (s *= 2));
                      var d = i[a].data.private.props.page.margin.top,
                        u = i[a].data.private.props.page.margin.bottom,
                        g = this.selection.selContext.backupMargins;
                      if (
                        (void 0 !== g && ((d = g.top), (u = g.bottom)),
                        e && ((d = e.top), (u = e.bottom)),
                        void 0 !== d && void 0 !== u)
                      ) {
                        c && (s -= l);
                        var f = (s - u) / 20 - 0.1;
                        (n.top = Math.min(n.top, f)),
                          (f = (s - d) / 20 - 0.1),
                          (n.bottom = Math.min(n.bottom, f));
                      }
                      var C = i[a].data.private.props.page.margin.left,
                        v = i[a].data.private.props.page.margin.right;
                      if (
                        (void 0 !== g && ((C = g.left), (v = g.right)),
                        e && ((C = e.left), (v = e.right)),
                        void 0 !== C && void 0 !== v)
                      ) {
                        void 0 === c || c || (r -= l);
                        var _ = (r - v) / 20 - 36;
                        (n.left = Math.min(n.left, _)),
                          (_ = (r - C) / 20 - 36),
                          (n.right = Math.min(n.right, _));
                      }
                    }
                  return {
                    t: p.default.init(n.top, p.UnitType.Unit_pt),
                    l: p.default.init(n.left, p.UnitType.Unit_pt),
                    r: p.default.init(n.right, p.UnitType.Unit_pt),
                    b: p.default.init(n.bottom, p.UnitType.Unit_pt),
                  };
                },
              },
              {
                key: "getSectionMargins",
                value: function () {
                  var e = this.selection,
                    t = e.end,
                    n = e.selContext;
                  if (!t) return 0;
                  if (void 0 !== n.backupMargins)
                    return {
                      t: p.default.init(
                        n.backupMargins.top,
                        p.UnitType.Unit_pt
                      ),
                      b: p.default.init(
                        n.backupMargins.bottom,
                        p.UnitType.Unit_pt
                      ),
                      l: p.default.init(
                        n.backupMargins.left,
                        p.UnitType.Unit_pt
                      ),
                      r: p.default.init(
                        n.backupMargins.right,
                        p.UnitType.Unit_pt
                      ),
                    };
                  var i = this.data.doc.sections.getSection(t.position);
                  if (!i) return 0;
                  var o = i.getPageMargin();
                  return {
                    t: p.default.init(o.top, p.UnitType.Unit_ti),
                    b: p.default.init(o.bottom, p.UnitType.Unit_ti),
                    l: p.default.init(o.left, p.UnitType.Unit_ti),
                    r: p.default.init(o.right, p.UnitType.Unit_ti),
                  };
                },
              },
              {
                key: "getPageSize",
                value: function () {
                  var e = this.selection.getNormalRange(),
                    t = this.data.doc.sections.getSection(e.pos);
                  if (t)
                    return {
                      heightValue: parseFloat(
                        Object(te.Ti2Cm)(t.getPageHeight()).toFixed(2)
                      ),
                      widthValue: parseFloat(
                        Object(te.Ti2Cm)(t.getPageWidth()).toFixed(2)
                      ),
                    };
                },
              },
              {
                key: "getWordCount",
                value: function () {
                  var e = this,
                    t = 0;
                  return (
                    this.selection.getNormalRanges().forEach(function (n) {
                      t += e.wordStat.GetWordCountInRange(n);
                    }),
                    t
                  );
                },
              },
              {
                key: "isSelectionEndInView",
                value: function () {
                  var e =
                      (this.selection.end.pos || this.selection.begin.pos)
                        .posY * window.APP.workspace.config.zoom,
                    t = window.APP.workspace.element;
                  return (
                    e > t.cacheDOMAttr.scrollTop &&
                    e < t.cacheDOMAttr.scrollTop + t.cacheDOMAttr.clientHeight
                  );
                },
              },
              {
                key: "getCurrentWordInfo",
                value: function () {
                  var e = this.selection.end.pos || this.selection.begin.pos;
                  if (!e) return null;
                  var t = window.APP,
                    n = t.workspace,
                    i = t.uilManager,
                    o = n.getCurrentRect();
                  this.data.typoinfo.updater.updateViewport(o);
                  var a = void 0,
                    s = void 0;
                  try {
                    if (this.isSelectionEndInView())
                      (s = this.selection.end.pageIndex),
                        this.selection.selContext.isInTextbox ||
                        this.selection.selContext.isInHeaderFooter
                          ? ((e =
                              this.data.typoinfo.layout_pages[s - 1].range.pos),
                            (a =
                              this.data.doc.sections.getSectionIndexByPos(e) +
                              1))
                          : (a = this.selection.end.sectionIndex);
                    else {
                      var r = i.getPositionOnVisible({});
                      if (r)
                        (s = r.layoutIndex + 1),
                          (e = this.selection.selContext.isInHeaderFooter
                            ? this.data.typoinfo.layout_pages[r.layoutIndex]
                                .range.pos
                            : r.position),
                          (a =
                            this.data.doc.sections.getSectionIndexByPos(e) + 1);
                      else {
                        var l = i.getPosByEvent({
                            pageX: 0,
                            pageY: n.element.getBoundingClientRect().top + 5,
                          }).y,
                          c = this.data.typoinfo.layout_pages,
                          h =
                            c.find(function (e, t) {
                              return (
                                (e.outer_rect.top <= l &&
                                  e.outer_rect.bottom >= l) ||
                                (t > 0 &&
                                  c[t - 1].outer_rect.bottom < l &&
                                  e.outer_rect.bottom >= l) ||
                                (t === c.length - 1 && l >= e.outer_rect.bottom)
                              );
                            }) || c[0];
                        (s = h.layout_index + 1),
                          (e = h.range
                            ? this.data.typoinfo.getPosition(h.range.pos)
                            : null),
                          (a = h.sectionIndex + 1);
                      }
                    }
                  } catch (e) {
                    (a = 1),
                      (s = this.selection.end.pageIndex),
                      console.warn(e);
                  }
                  return { pos: e, sectionIndex: a, pageIndex: s };
                },
              },
              {
                key: "getPageOrientation",
                value: function () {
                  if (!this.selection.end) return 0;
                  var e = void 0;
                  if (window.APP.isWebMode()) e = 0;
                  else {
                    var t = this.selection.end.pos.layoutIndex;
                    e =
                      this.data.typoinfo.layout_pages[t].mainpages[0].range.pos;
                  }
                  var n = this.data.doc.sections.getSection(e);
                  return void 0 === n ? 0 : n.getPageOrientation();
                },
              },
              {
                key: "getLineNumbering",
                value: function () {
                  if (!this.selection.end) return null;
                  var e = void 0;
                  if (window.APP.isWebMode()) e = 0;
                  else if (
                    this.selection.begin.position <
                    this.data.doc.getBodyRange(0).end
                  )
                    e = this.selection.begin.position;
                  else {
                    var t = this.selection.end.pos.layoutIndex;
                    e =
                      this.data.typoinfo.layout_pages[t].mainpages[0].range.pos;
                  }
                  var n = this.data.doc.sections.getSection(e);
                  return void 0 === n ? null : n.getLineNumbering();
                },
              },
              {
                key: "hasSeparatorLine",
                value: function () {
                  for (
                    var e = this.selection.getNormalRange(),
                      t = this.data.doc
                        .getDataLogic("final")
                        .collectPapxs(e.pos, e.len),
                      n = 0;
                    n < t.length;
                    ++n
                  ) {
                    var i =
                      this.data.doc.inlineAnchors.findAnchor(t[n].pos) ||
                      this.data.doc.anchors.findAnchor(t[n].pos);
                    if (
                      i &&
                      i.data &&
                      i.data.private &&
                      i.data.private.isHorizontalRule
                    ) {
                      var o = i.shapeData;
                      if (o && o.shapeType === oe.sptLine) return !0;
                    }
                  }
                  return !1;
                },
              },
              {
                key: "hasTable",
                value: function () {
                  for (
                    var e = this.selection.getNormalRange(),
                      t = this.data.doc
                        .getDataLogic("final")
                        .collectPapxs(e.pos, e.len),
                      n = 0;
                    n < t.length;
                    ++n
                  )
                    if (t[n].prop && 0 !== t[n].prop.getPropVal("nest_level"))
                      return !0;
                  return !1;
                },
              },
              {
                key: "isInTable",
                value: function () {
                  var e =
                      arguments.length > 0 && void 0 !== arguments[0]
                        ? arguments[0]
                        : this.selection.begin.position,
                    t = this.data.doc.getDataLogic("final").getPap(e);
                  if (!t) return !1;
                  var n = t.getPropVal("nest_level");
                  return !(0 === n);
                },
              },
              {
                key: "isInNestTable",
                value: function () {
                  var e = this.selection.getNormalRanges(),
                    t = this.data.doc.getDataLogic("final"),
                    n = Number.MAX_SAFE_INTEGER,
                    i = Number.MIN_SAFE_INTEGER;
                  return (
                    e.forEach(function (e) {
                      t.collectPapxs(e.pos, e.len).forEach(function (e) {
                        (n = Math.min(n, e.prop.nest_level)),
                          (i = Math.max(i, e.prop.nest_level));
                      });
                    }),
                    n > 1 && n === i
                  );
                },
              },
              {
                key: "getTableBackColor",
                value: function () {
                  for (
                    var e = this.selection.getNormalRanges(),
                      t = {},
                      n = 0,
                      i = e.length;
                    n < i;
                    n++
                  )
                    for (
                      var o = this.data.doc
                          .getDataLogic("final")
                          .specTable.collectTapxs(e[n].pos, e[n].len),
                        a = 0,
                        s = o.length;
                      a < s;
                      a++
                    ) {
                      var r = o[a],
                        l = r.cellDatas,
                        c = e[n],
                        h = c.pos,
                        d = c.len;
                      if (l)
                        for (var p = 0, u = l.length; p < u; p++) {
                          var g = r.cells[p],
                            f = l[p].begin;
                          if (f === h && 0 === n) t = g.shd && g.shd.backColor;
                          else if (
                            f > h &&
                            f < h + d &&
                            t &&
                            (g.shd &&
                              g.shd.backColor &&
                              g.shd.backColor.hex) !== t.hex
                          )
                            return -1;
                        }
                    }
                  return t;
                },
              },
              {
                key: "isRepeatHeaderRow",
                value: function (e) {
                  var t = this,
                    n = [],
                    i = -1,
                    o = void 0,
                    a = void 0,
                    s = void 0;
                  if (void 0 === e) {
                    var r = this.selection.getNormalRange();
                    (o = r.pos),
                      (a = r.len),
                      (s = this.selection.getNormalRanges());
                  } else s = [{ pos: (o = e), len: (a = 1) }];
                  var l = this.data.typoinfo.tableLineRanges,
                    c = !1;
                  l.forEachHintInRange(
                    o,
                    o + a,
                    function (n) {
                      var a = (n && n._node && n._node.line) || {},
                        s = a.isRepeatHeaderRow,
                        r = a.isHeaderRow;
                      if (!s && r) {
                        c = !0;
                        var l = void 0 !== e ? e : o;
                        if (
                          (t.data.typoinfo.tableLineRanges.forEachHintInRange(
                            l,
                            l,
                            function (e) {
                              var t = e && e._node && e._node.line,
                                n = t || {},
                                o = n.isRepeatHeaderRow,
                                a = n.isHeaderRow;
                              if (!o && a)
                                return (i = t.viewPage.layout_index), !0;
                            }
                          ),
                          -1 === i)
                        ) {
                          var h =
                            t.data.typoinfo.textLineRanges.findNodeContainPos(
                              l
                            );
                          h && (i = h.line.viewPage.layout_index);
                        }
                        return !0;
                      }
                    },
                    d.IT.strictIntersectTest
                  );
                  for (var h = 0, p = s.length; h < p; h++) {
                    this.data.doc
                      .getDataLogic("final")
                      .specTable.collectTapxs(s[h].pos, s[h].len)
                      .forEach(function (e) {
                        e.prop &&
                          e.prop.table_row &&
                          e.prop.table_row.repeatHeader &&
                          n.push(e);
                      });
                  }
                  return {
                    isRepeat: c,
                    repeatHeaderPageIndex: i,
                    topLevelRepeatRowArray: n,
                  };
                },
              },
              {
                key: "getValidActiveDocumentFieldNames",
                value: function () {
                  var e = this.selection.selContext.activeDocumentFieldNames,
                    t = this.data.doc.documentFields,
                    n = !1;
                  return (
                    e &&
                      e.some(function (e) {
                        if (!t.getFieldByName(e)) return (n = !0), !0;
                      }),
                    n ? null : e
                  );
                },
              },
              {
                key: "checkIsSelInReadOnlyDocumentField",
                value: function () {
                  var e = this.selection.selContext.activeDocumentFieldNames;
                  if (e && e.length) {
                    var t = this.data.doc.documentFields;
                    return e.some(function (e) {
                      var n = t.getFieldByName(e);
                      return n && n.readonly;
                    });
                  }
                  return !1;
                },
              },
              {
                key: "isSelOutTextFormField",
                value: function () {
                  var e = this.selection.data.fieldManager,
                    t = e.getField(this.selection.begin.position);
                  return (
                    null == t &&
                      (t = e.getField(this.selection.end.position - 1)),
                    !t || "FORMTEXT" !== t.getType()
                  );
                },
              },
              {
                key: "isSelEqZone",
                value: function () {
                  var e = this.selection.begin.pos,
                    t = this.selection.end.pos;
                  if (e && t) {
                    var n = e.glyphGroupInfo,
                      i = t.glyphGroupInfo;
                    if (n && i) return n.zone == i.zone && n.zone.isEqZone;
                  }
                  return !1;
                },
              },
              {
                key: "getAlignment",
                value: function () {
                  var e = this.getPapx();
                  if (void 0 === e) return m.Adjustify;
                  if (e.mixMarks.horizontal_align_mode) return -1;
                  var t = e.horizontal_align_mode;
                  return void 0 === t
                    ? -1
                    : (e.bidi == P.b &&
                        (t === m.Right
                          ? (t = m.Left)
                          : t === m.Left && (t = m.Right)),
                      t);
                },
              },
              {
                key: "getVerticalAlignment",
                value: function () {
                  for (
                    var e = this.selection.getNormalRanges(),
                      t = -1,
                      n = 0,
                      i = e.length;
                    n < i;
                    n++
                  )
                    for (
                      var o = this.data.doc
                          .getDataLogic("final")
                          .specTable.collectTapxs(e[n].pos, e[n].len),
                        a = 0,
                        s = o.length;
                      a < s;
                      a++
                    ) {
                      var r = o[a],
                        l = r.cellDatas,
                        c = e[n],
                        h = c.pos,
                        d = c.len;
                      if (l)
                        for (var p = 0, u = l.length; p < u; p++) {
                          var g = r.cells[p],
                            f = l[p].begin;
                          if (f === h && 0 === n) t = g.vertAlign;
                          else if (
                            f > h &&
                            f < h + d &&
                            g.vertAlign !== t &&
                            g.vertAlign !== y.Top
                          )
                            return -1;
                        }
                    }
                  return t;
                },
              },
              {
                key: "getTableAlignment",
                value: function () {
                  var e = this.selection.getNormalRange().pos,
                    t = this.data.doc.getDataLogic("final").specTable.getTapx(e)
                      .prop.table_row.horzAlignMode;
                  return t ? t - 1 : 0;
                },
              },
              {
                key: "getLineSpacing",
                value: function () {
                  var e = this.getPapx();
                  if (void 0 === e) return { value: 1 };
                  if (e.mixMarks.line_spacing) return { value: -1 };
                  var t = e.line_spacing;
                  return void 0 === t || void 0 === t.value
                    ? { value: 1 }
                    : "exact" === t.rule || "atLeast" === t.rule
                    ? {
                        value: Object(te.Ti2Pt)(parseInt(t.value)),
                        rule: t.rule,
                      }
                    : { value: t.value / 240, rule: "auto" };
                },
              },
              {
                key: "getList",
                value: function (e) {
                  for (
                    var t =
                        void 0 === e ? this.selection.getCmdExecuteRanges() : e,
                      n = t.length,
                      i = { index: 0, isBullet: !1 },
                      o = 0;
                    o < n;
                    ++o
                  ) {
                    var a = t[o],
                      s = new A.a({ rg: a, doc: this.data.doc });
                    if (0 === o) i = s.indexInfo;
                    else if (
                      s.indexInfo.index !== i.index ||
                      s.indexInfo.isBullet !== i.isBullet
                    ) {
                      i = { index: -1, isBullet: !1 };
                      break;
                    }
                    if (-1 === i.index) break;
                  }
                  return i;
                },
              },
              {
                key: "getListType",
                value: function (e) {
                  var t =
                    void 0 === e ? this.selection.getCmdExecuteRanges() : e;
                  return Object(A.b)(t);
                },
              },
              {
                key: "isInTaskList",
                value: function () {
                  return this.getListType() === k.d;
                },
              },
              {
                key: "_getProp",
                value: function (e) {
                  var t = this.getPapx();
                  if (void 0 === t) return { val: 0, isMix: !0, isDef: !1 };
                  var n = t[e];
                  if (void 0 === n) {
                    var i = null != t.mixMarks && t.mixMarks[e];
                    return { val: t.def[e], isMix: i, isDef: !i };
                  }
                  return { val: n, isMix: !1, isDef: !1 };
                },
              },
              {
                key: "getReadingOrder",
                value: function () {
                  return this._getProp("bidi");
                },
              },
              {
                key: "_getIndent",
                value: function (e, t) {
                  var n = this._getProp(e);
                  return (
                    (n.isRef = !0),
                    n.isMix
                      ? n
                      : n.isDef || 0 === n.val
                      ? (((n = this._getProp(t)).isRef = !1),
                        (n.val = n.val / 20),
                        n)
                      : ((n.val = n.val / 100), n)
                  );
                },
              },
              {
                key: "getLeftIndent",
                value: function () {
                  var e = this._getIndent(
                    "left_indent_chars",
                    "left_indent_abs"
                  );
                  if (e.isMix || e.isRef) return e;
                  var t = this._getIndent(
                    "first_line_indent_chars",
                    "first_line_indent_abs"
                  );
                  return (
                    !t.isMix &&
                      t.val < 0 &&
                      (t.isRef
                        ? ((e.val = 0), (e.isRef = !0))
                        : (e.val = e.val + t.val)),
                    e
                  );
                },
              },
              {
                key: "getFirstLineIndent",
                value: function () {
                  return this._getIndent(
                    "first_line_indent_chars",
                    "first_line_indent_abs"
                  );
                },
              },
              {
                key: "getRightIndent",
                value: function () {
                  return this._getIndent(
                    "right_indent_chars",
                    "right_indent_abs"
                  );
                },
              },
              {
                key: "_getSpace",
                value: function (e, t, n) {
                  var i = this._getProp(n);
                  return i.isMix || i.isDef || !i.val
                    ? (i = this._getProp(t)).isMix || (!i.isDef && i.val)
                      ? ((i.val /= 100), (i.isRef = !0), i)
                      : (((i = this._getProp(e)).val /= 20), (i.isRef = !1), i)
                    : ((i.isAuto = !0), (i.val = 0), i);
                },
              },
              {
                key: "getSpaceBefore",
                value: function () {
                  return this._getSpace(
                    "para_margin_before",
                    "para_lineunit_margin_before",
                    "para_margin_before_auto"
                  );
                },
              },
              {
                key: "getSpaceAfter",
                value: function () {
                  return this._getSpace(
                    "para_margin_after",
                    "para_lineunit_margin_after",
                    "para_margin_after_auto"
                  );
                },
              },
              {
                key: "getOutlineLevel",
                value: function () {
                  var e = this._getProp("out_line_level");
                  return e.isMix ? "" : e.val;
                },
              },
              {
                key: "getFarEastLineBreakControl",
                value: function () {
                  return this._getProp("kinsoku");
                },
              },
              {
                key: "getWordWrap",
                value: function () {
                  return this._getProp("word_wrap");
                },
              },
              {
                key: "getHangingPunctuation",
                value: function () {
                  return this._getProp("overflow_punct");
                },
              },
              {
                key: "getHalfWidthPunctuationOnTopOfLine",
                value: function () {
                  return this._getProp("topline_punct");
                },
              },
              {
                key: "getAddSpaceBetweenFarEastAndAlpha",
                value: function () {
                  return this._getProp("auto_space_de");
                },
              },
              {
                key: "getAddSpaceBetweenFarEastAndDigit",
                value: function () {
                  return this._getProp("auto_space_dn");
                },
              },
              {
                key: "getWidowControl",
                value: function () {
                  return this._getProp("widow_control");
                },
              },
              {
                key: "getKeepWithNext",
                value: function () {
                  return this._getProp("keep_next");
                },
              },
              {
                key: "getKeepTogether",
                value: function () {
                  return this._getProp("keep_lines");
                },
              },
              {
                key: "getPageBreakBefore",
                value: function () {
                  return this._getProp("page_break_before");
                },
              },
              {
                key: "getBold",
                value: function () {
                  var e = this.getChpx();
                  return void 0 !== e && void 0 !== e.bold && !1 !== e.bold;
                },
              },
              {
                key: "getItalic",
                value: function () {
                  var e = this.getChpx();
                  return void 0 !== e && void 0 !== e.italic && !1 !== e.italic;
                },
              },
              {
                key: "getUnderline",
                value: function () {
                  var e = this.getChpx();
                  if (void 0 === e) return null;
                  var t = e.underline;
                  if (void 0 === t || t !== w.Normal) return null;
                  var n =
                    this.selection.begin.pos &&
                    this.selection.begin.pos.glyphGroupInfo;
                  return n &&
                    n.isInTOCField() &&
                    !n.underline_type &&
                    !n.underline_color
                    ? null
                    : {
                        underlineType: e.underline_type,
                        underlineColor: e.underline_color,
                      };
                },
              },
              {
                key: "getUnderlineEx",
                value: function () {
                  var e = this.selection.getCmdExecuteRanges(),
                    t = e.length;
                  if (t <= 0) return { underlineType: 0, underlineColor: "" };
                  var n = void 0,
                    i = void 0,
                    o = void 0,
                    a = void 0,
                    s = void 0,
                    r = void 0;
                  function l(e) {
                    void 0 !== e &&
                      ((n = e.underline ? e.underline_type : 0),
                      (i = e.underline ? e.underline_color : ""));
                  }
                  if (1 === t && 0 === e[0].len)
                    return (
                      l(this.getChpx()), { underlineType: n, underlineColor: i }
                    );
                  for (
                    var c = this.data.doc.getDataLogic("final"), h = 0;
                    h < t;
                    ++h
                  )
                    for (
                      var d = c.collectChpxs(e[h].pos, e[h].len), p = 0;
                      p < d.length &&
                      ((o = n),
                      (a = i),
                      l(d[p].prop),
                      p > 0 && (a !== i && (r = !0), o !== n && (s = !0)),
                      !s || !r);
                      ++p
                    );
                  return {
                    underlineType: s ? "" : n,
                    underlineColor: r ? "" : i,
                  };
                },
              },
              {
                key: "getStrikeThrough",
                value: function () {
                  var e = this.getChpx();
                  return void 0 !== e && void 0 !== e.strike && !1 !== e.strike;
                },
              },
              {
                key: "getSize",
                value: function () {
                  var e = this.getChpx();
                  if (void 0 !== e)
                    return e.getPropVal("complex_script") ||
                      e.getPropVal("share_hint") === I.Complex
                      ? e.getPropVal("font_size_cs")
                      : e.getPropVal("font_size_normal");
                },
              },
              {
                key: "getSuperscript",
                value: function () {
                  var e = this.getChpx();
                  return (
                    void 0 !== e && void 0 !== e.script_pos && e.script_pos > 0
                  );
                },
              },
              {
                key: "getSubscript",
                value: function () {
                  var e = this.getChpx();
                  return (
                    void 0 !== e && void 0 !== e.script_pos && e.script_pos < 0
                  );
                },
              },
              {
                key: "getName",
                value: function () {
                  var e = new z(this.selection).getFontId();
                  return void 0 === e ? "" : this.data.doc.fonttable.getName(e);
                },
              },
              {
                key: "getColor",
                value: function () {
                  var e = this.getChpx();
                  return void 0 === e || void 0 === e.font_color
                    ? "#000000"
                    : e.font_color;
                },
              },
              {
                key: "getColorEx",
                value: function () {
                  var e = this.selection.getCmdExecuteRanges(),
                    t = e.length;
                  return t <= 0
                    ? ""
                    : 1 === t && 0 === e[0].len
                    ? this.getColor()
                    : this.getPropertyUnmixed("font_color") || "";
                },
              },
              {
                key: "getHighlightColor",
                value: function () {
                  var e = this.getChpx() || {
                    highLightColor: "#ffffffffff000000",
                  };
                  return {
                    highLightColor: e.highlight_color,
                    isMixed: e.mixMarks.highlight_color,
                  };
                },
              },
              {
                key: "getAllCaps",
                value: function () {
                  var e = this.getChpx();
                  return (
                    void 0 !== e && void 0 !== e.caps && !1 !== Boolean(e.caps)
                  );
                },
              },
              {
                key: "getSmallCaps",
                value: function () {
                  var e = this.getChpx();
                  return (
                    void 0 !== e &&
                    void 0 !== e.small_caps &&
                    !1 !== Boolean(e.small_caps)
                  );
                },
              },
              {
                key: "getDoubleStrikeThrough",
                value: function () {
                  var e = this.getChpx();
                  return (
                    void 0 !== e &&
                    void 0 !== e.double_strike &&
                    !1 !== e.double_strike
                  );
                },
              },
              {
                key: "getEmphasisMark",
                value: function () {
                  var e = this.getChpx();
                  return void 0 !== e && void 0 !== e.emphasis_type
                    ? e.emphasis_type
                    : S.a;
                },
              },
              {
                key: "getScaling",
                value: function () {
                  var e = this.getChpx();
                  return void 0 !== e && void 0 !== e.character_scale
                    ? e.character_scale
                    : this.info.isPoint
                    ? 100
                    : this.getPropertyUnmixed("character_scale");
                },
              },
              {
                key: "getPropertyUnmixed",
                value: function (e) {
                  var t = this.selection.getCmdExecuteRanges(),
                    n = !1,
                    i = void 0;
                  if (t.length > 1 || t[0].len > 0)
                    for (
                      var o = this.data.doc.getDataLogic("final"), a = 0;
                      a < t.length && !n;
                      ++a
                    )
                      for (
                        var s = o.collectChpxs(t[a].pos, t[a].len), r = 0;
                        r < s.length;
                        ++r
                      ) {
                        var l = s[r].prop.getPropVal(e);
                        if (
                          ("font_color" !== e || l || (l = "#000000"),
                          0 === a && 0 === r)
                        )
                          i = l;
                        else if (l !== i) {
                          n = !0;
                          break;
                        }
                      }
                  return n ? void 0 : i;
                },
              },
              {
                key: "getSpacing",
                value: function () {
                  var e = this.getChpx();
                  return void 0 !== e && void 0 !== e.spacing
                    ? e.spacing / 20
                    : this.getPropertyUnmixed("spacing");
                },
              },
              {
                key: "getTableMultipleSelectLastLinePos",
                value: function () {
                  var e = !1;
                  if (this.isInTable()) {
                    var t = this.selection.getNormalRanges() || [];
                    (e = t[0]),
                      t.forEach(function (t) {
                        e = t.pos > e.pos ? t : e;
                      });
                  }
                  return e;
                },
              },
              {
                key: "containDrawing",
                value: function (e) {
                  for (var t = 0; t < e.length; ++t) {
                    var n = this.data.doc.getText(e[t].pos, e[t].len);
                    if (void 0 !== n)
                      for (var i = 0; i < n.length; ++i) {
                        var o = n.charCodeAt(i);
                        if (o === _.Embed || o === _.Drawing) return !0;
                      }
                  }
                  return !1;
                },
              },
              {
                key: "containNotAllowedNonNestControl",
                value: function (e) {
                  for (var t = 0; t < e.length; ++t) {
                    var n = this.data.doc.getText(e[t].pos, e[t].len);
                    if (void 0 !== n)
                      for (var i = 0; i < n.length; ++i) {
                        var o = n.charCodeAt(i);
                        if (
                          o === _.FootNote ||
                          o === _.FieldBegin ||
                          o === _.FieldEnd ||
                          o === _.ControlBegin ||
                          o === _.ControlEnd
                        )
                          return !0;
                      }
                  }
                  return !1;
                },
              },
              {
                key: "_isHitBeforeCtrl",
                value: function (e, t, n) {
                  return e === n.begin && !t;
                },
              },
              {
                key: "_isHitOnInlineCtrl",
                value: function (e, t) {
                  if (e && e.isRepeatItem) return !1;
                  var n = this.data.doc
                    .getDataLogic("final")
                    .collectPapxs(e.pos, e.len);
                  if (1 === n.length) {
                    for (
                      var i = s()(n, 1)[0],
                        o = { begin: e.begin, end: e.end },
                        a = 1;
                      a < t.length;
                      a++
                    ) {
                      if (t[a].end - 1 !== o.end) break;
                      o.end++;
                    }
                    return !(o.begin === i.pos && o.end + 1 === i.pos + i.len);
                  }
                  return !1;
                },
              },
              {
                key: "_isHitAroundBlockCtrl",
                value: function (e) {
                  var t = this,
                    n = this.data.doc.getDataLogic("final").getPapx(e),
                    i = this.data.doc.contentControls
                      .collect(n.pos, n.len)
                      .sort(function (e, t) {
                        return t.pos - e.pos;
                      });
                  return i.some(function (n) {
                    return (
                      (n.begin === e || n.end === e) &&
                      !t._isHitOnInlineCtrl(n, i)
                    );
                  });
                },
              },
              {
                key: "isHitOnCtrl",
                value: function (e) {
                  var t = this,
                    n = {
                      isHitOnDatetime: !1,
                      isHitOnDropList: !1,
                      isHitOnRichText: !1,
                      isHitOnInlineCtrl: !1,
                      isHitAroundBlockCtrl: !1,
                      isIncludedByCtrl: !1,
                      isHitOnPureText: !1,
                      isHitOnPicture: !1,
                      isHitOnComboBox: !1,
                      isHitOnCheckBox: !1,
                      isHitOnRepeatSec: !1,
                      isHitOnRepeatItem: !1,
                    },
                    i = e || this.selection.getNormalRange(),
                    o = this.data.doc.contentControls.collect(i.pos, i.len, !0);
                  return (
                    o.forEach(function (e) {
                      t._isHitBeforeCtrl(i.pos, i.len, e) ||
                        (e.begin < i.pos &&
                          i.pos + i.len <= e.end &&
                          (n.isIncludedByCtrl = !0),
                        e.isDate && (n.isHitOnDatetime = !0),
                        e.isDropdownList && (n.isHitOnDropList = !0),
                        e.isRichText && (n.isHitOnRichText = !0),
                        e.isPureText && (n.isHitOnPureText = !0),
                        e.isPicture && (n.isHitOnPicture = !0),
                        e.isComboBox && (n.isHitOnComboBox = !0),
                        e.isCheckBox && (n.isHitOnCheckBox = !0),
                        e.isRepeatSec && (n.isHitOnRepeatSec = !0),
                        e.isRepeatItem && (n.isHitOnRepeatItem = !0),
                        t._isHitOnInlineCtrl(e, o) &&
                          (n.isHitOnInlineCtrl = !0),
                        e.isRepeatSec ||
                          e.isRichText ||
                          ((i.pos <= e.begin && i.pos + i.len >= e.end) ||
                            (n.notIncluedeSpecCtrl = !0),
                          e.isPicture &&
                            e.begin < i.pos &&
                            i.pos + i.len <= e.end &&
                            (n.isIncludedByPicCtrl = !0)));
                    }),
                    i.len ||
                      (n.isHitAroundBlockCtrl = this._isHitAroundBlockCtrl(
                        i.pos
                      )),
                    n
                  );
                },
              },
              {
                key: "_crossCell",
                value: function (e, t) {
                  var n = this.getSelectionInfo(),
                    i = this.data.doc.getDataLogic("final");
                  if (n.inTable) {
                    if (
                      n.tableSelected ||
                      n.wholeCellSelected ||
                      n.rowSelected ||
                      n.columnSelected
                    )
                      return !0;
                    if (
                      n.cells &&
                      (n.cells.length > 1 || n.cells[0].length > 1)
                    )
                      return !0;
                    var o = i.getPapx(e);
                    if (t > o.pos + o.len) return !0;
                  } else
                    for (var a = void 0, s = e; s < t; ) {
                      var r = i.getPapx(s),
                        l = r.prop.getPropVal("nest_level");
                      if (void 0 === a) a = l;
                      else if (l !== a) return !0;
                      s = r.pos + r.len;
                    }
                  return !1;
                },
              },
              {
                key: "getHyperlink",
                value: function () {
                  var e = this.selection.getActiveAreaNormalRanges();
                  if (e.length > 1) return null;
                  var t = e[0],
                    n = t.pos,
                    i = t.pos + t.len;
                  if (this._crossCell(n, i)) return null;
                  for (
                    var o = this.data.doc.fields.getFields({
                        begin: n,
                        end: i,
                      }),
                      a = null,
                      s = 0,
                      r = 0;
                    r < o.length;
                    ++r
                  )
                    if ("HYPERLINK" === o[r]._node.type) {
                      if (++s > 1) return null;
                      a = new $.a(this.data, o[r]._node);
                    }
                  return a;
                },
              },
              {
                key: "_getCellBegin",
                value: function (e) {
                  var t = this.data.doc
                      .getDataLogic("final")
                      .specTable.getTapx(e),
                    n = t.cellDatas.findIndex(function (t) {
                      return e < t.end;
                    });
                  return n >= 0 ? t.cellDatas[n].begin : e;
                },
              },
              {
                key: "_isInTable",
                value: function (e, t) {
                  return (
                    Object(R.getTopLevel)(
                      this.data.doc.getDataLogic("final"),
                      e,
                      t,
                      !1
                    ) > 0
                  );
                },
              },
              {
                key: "_distance",
                value: function (e, t, n) {
                  var i = this.data.doc
                    .getDataLogic("final")
                    .specTable.getTapx(e, d.IT.Include, t);
                  return i.prop
                    ? i.cellDatas.findIndex(function (t) {
                        return e < t.end;
                      })
                    : 0;
                },
              },
              {
                key: "_getNextPapPos",
                value: function (e, t, n) {
                  var i = t.row;
                  if (
                    t.rowSelected ||
                    1 !== n.length ||
                    !i.table_row ||
                    !i.table_row.tableCells ||
                    !i.table_row.rgdxa
                  )
                    return e;
                  var o = this.data.doc.getDataLogic("final").specTable,
                    a = e,
                    s = i.table_row.tableCells[n[0]],
                    r = i.table_row.rgdxa[n[0]];
                  if (s && s.vertMerge === ne.MERGE_TYPE.FIRST && r)
                    for (var l = o.getTapx(e); l; ) {
                      if (!l.prop) {
                        a = l.begin;
                        break;
                      }
                      var c = l.prop.table_row,
                        h = c.rgdxa,
                        d = c.tableCells;
                      if (!h || 0 === h.length || !d || 0 === d.length) break;
                      var p = h.findIndex(function (e) {
                        return e === r;
                      });
                      if (-1 === p) break;
                      var u = d[p];
                      if (u && u.vertMerge !== ne.MERGE_TYPE.MIDDLE) {
                        a = l.begin;
                        break;
                      }
                      l = o.getTapx(l.end);
                    }
                  return a;
                },
              },
              {
                key: "_getRangeInfo",
                value: function (e, t) {
                  var n = {},
                    i = e.pos,
                    o = e.pos + e.len,
                    a = this.data.doc.getDataLogic("final"),
                    s = a.specTable,
                    r = Number.MAX_SAFE_INTEGER,
                    l = Number.MIN_SAFE_INTEGER,
                    c = a.getPap(o > i ? o - 1 : i),
                    h = c.getPropVal("nest_level"),
                    p = c.getPropVal("type");
                  if (0 === h || !this._isInTable(i, o))
                    return (n.isNormal = !0), n;
                  (n.inTable = !0),
                    c.getPropVal("para_type") === C.d &&
                      a.getPap(i).getPropVal("nest_level") >= h &&
                      e.len > 1 &&
                      ((n.columnCnt = c.table_row.tableCells.length),
                      (n.rowSelected = !0));
                  for (
                    var u = [], g = this._getCellBegin(i), f = i;
                    f < o || 0 === u.length;

                  ) {
                    var v = a.getPapx(f),
                      _ = v.prop.getPropVal("nest_level") || 0,
                      x = v.prop.getPropVal("para_type");
                    if (((r = Math.min(r, _)), (l = Math.max(l, _)), !_)) break;
                    x === C.b && _ === h
                      ? (u.push({ begin: g, end: v.pos + v.len }),
                        (g = v.pos + v.len))
                      : x === C.d && _ === h && (g = v.pos + v.len),
                      (f = v.pos + v.len);
                  }
                  if (((n.minLevel = r), (n.maxLevel = l), n.rowSelected))
                    n.row = c;
                  else {
                    var T = s.getTapx(f, d.IT.Include, h);
                    (n.row = T.prop), (f = T.end);
                  }
                  var b = [];
                  if (u.length > 0)
                    for (
                      var m = this._distance(u[0].begin, h, p), y = 0;
                      y < u.length;
                      ++y
                    )
                      b.push(m + y);
                  n.isLastRow = !1;
                  var k = this._getNextPapPos(f, n, b),
                    P = a.getPap(k);
                  (P.getPropVal("nest_level") < h ||
                    P.getPropVal("type") !== p ||
                    !ie.isInSameTable(this.data.doc, k, i, t)) &&
                    (n.isLastRow = !0);
                  var w = 0,
                    S = this.data.doc.getLimitedRange(i);
                  S && (w = S.pos), (n.isFirstRow = i === w);
                  for (var I = i - 1; I >= w; ) {
                    var E = a.getPapx(I),
                      F = E.prop.getPropVal("nest_level"),
                      R = E.prop.getPropVal("para_type"),
                      N = E.prop.getPropVal("type"),
                      A = ie.isInSameTable(this.data.doc, I, i, t);
                    if (R === C.d && F === h && N === p && A) {
                      n.isFirstRow = !1;
                      break;
                    }
                    if (F < h || N !== p) {
                      n.isFirstRow = !0;
                      break;
                    }
                    if (E.pos === w) {
                      n.isFirstRow = !0;
                      break;
                    }
                    I = E.pos - 1;
                  }
                  if (
                    ((n.cells = u),
                    (n.idxs = b),
                    (n.columnCnt = b.length),
                    (n.wholeCellSelected = !0),
                    u.length > 0 &&
                      (u[0].begin !== i ||
                        u[u.length - 1].end !== (n.rowSelected ? o - 1 : o)) &&
                      (n.wholeCellSelected = !1),
                    n.wholeCellSelected && !n.rowSelected)
                  ) {
                    var L = s.getTapx(i);
                    L &&
                      L.cellDatas &&
                      1 === L.cellDatas.length &&
                      (n.rowSelected = !0);
                  }
                  return (
                    (n.wholeCellSelected || n.rowSelected) &&
                      (n.cellsSelected = !0),
                    n
                  );
                },
              },
              {
                key: "_getRelativeLine",
                value: function (e, t) {
                  for (
                    var n = this.data.doc.getDataLogic("final"),
                      i = E.default.locate(
                        this.data,
                        e,
                        !1,
                        this.data.typoinfo
                      ).line;
                    i &&
                    (i.layoutType !== N.DOCLayoutType.TableLine ||
                      n
                        .getPap(i.range.pos + i.range.len - 1)
                        .getPropVal("nest_level") !== t);

                  )
                    i =
                      i.layoutType == N.DOCLayoutType.SnippetScene
                        ? i.outer
                        : i.parent;
                  return i;
                },
              },
              {
                key: "_splitRanges",
                value: function (e) {
                  if (1 !== e.length) return e;
                  var t = e[0].pos,
                    n = e[0].pos + e[0].len,
                    i = this.data.doc.getDataLogic("final"),
                    o = i.getPap(n > t ? n - 1 : t);
                  if (o.getPropVal("para_type") !== C.d) return e;
                  for (
                    var a = o.getPropVal("nest_level"),
                      s = o.getPropVal("type"),
                      r = t,
                      l = [],
                      c = t;
                    c < n;

                  ) {
                    var h = i.getPapx(c),
                      d = h.prop.getPropVal("nest_level"),
                      p = h.prop.getPropVal("para_type"),
                      u = h.prop.getPropVal("type");
                    if (p === C.d && d === a && u === s) {
                      var g = { pos: r, len: c - r + 1 };
                      l.push(g), (r = c + 1);
                    }
                    c = h.pos + h.len;
                  }
                  return l;
                },
              },
              {
                key: "getCtrlsInRanges",
                value: function (e) {
                  var t = this,
                    n = [];
                  return (
                    e.forEach(function (e) {
                      var i = e.pos,
                        a = e.len,
                        s = t.data.doc.contentControls.collect(i, a, !0);
                      n = [].concat(o()(n), o()(s));
                    }),
                    n
                  );
                },
              },
              {
                key: "getAreaInfo",
                value: function () {
                  var e = this,
                    t = {},
                    n = this.data.doc.getDataLogic("final"),
                    i = window.APP.isWebMode(),
                    o = this.selection.getNormalRanges();
                  o[0].pos > o[o.length - 1].pos && o.reverse();
                  var a = o[0].pos,
                    s = o[o.length - 1].pos + o[o.length - 1].len;
                  if (
                    ((t.begin = a),
                    (t.end = s),
                    (t.containDrawing = this.containDrawing(o)),
                    t.containDrawing)
                  ) {
                    var r = window.APP.data.doc.anchors.getAnchors(a, s - a);
                    t.containDrawingWithoutEmbed = !!r.find(function (e) {
                      return e.anchor.wrapMode !== v.Embed;
                    });
                  }
                  if (
                    ((t.ctrls = this.getCtrlsInRanges(o)),
                    (t.containNotAllowedNonNestControl =
                      this.containNotAllowedNonNestControl(o)),
                    t.begin === t.end &&
                      ((t.isPoint = !0),
                      n.getPap(a).getPropVal("para_type") === C.d))
                  )
                    return (t.inTable = !0), (t.isRowEnd = !0), t;
                  var l = this._splitRanges(o);
                  (t.minLevel = Number.MAX_SAFE_INTEGER),
                    (t.maxLevel = Number.MIN_SAFE_INTEGER);
                  for (
                    var c = {},
                      h = l.map(function (n) {
                        var i = e._getRangeInfo(n, c);
                        return (
                          (t.minLevel = Math.min(t.minLevel, i.minLevel)),
                          (t.maxLevel = Math.max(t.maxLevel, i.maxLevel)),
                          i
                        );
                      }),
                      d = 0;
                    d < h.length;
                    ++d
                  )
                    if (h[d].isNormal) return (t.isNormal = !0), t;
                  (t.inTable = !0),
                    (t.tableSelected = !1),
                    (t.rowSelected = !0);
                  for (var p = 0; p < h.length; ++p)
                    if (!h[p].rowSelected) {
                      t.rowSelected = !1;
                      break;
                    }
                  if (h[0].isFirstRow && h[h.length - 1].isLastRow) {
                    var u = this.data.doc
                        .getDataLogic("final")
                        .specTable.collectTapxs(a, s - a),
                      g = h.length === u.length;
                    (t.tableSelected = g && t.rowSelected),
                      (t.columnSelected = !0),
                      (t.tableRowCnt = h.length);
                  } else {
                    t.columnSelected = !1;
                    var f = 0,
                      _ = n.getPap(a).getPropVal("nest_level"),
                      x = n.getPap(a).getPropVal("type"),
                      T = 0,
                      b = this.data.doc.getLimitedRange(a);
                    b && (T = b.pos);
                    for (var m = a - 1; m >= T; ) {
                      var y = n.getPapx(m),
                        k = y.prop,
                        P = k.getPropVal("para_type"),
                        w = k.getPropVal("nest_level"),
                        S = k.getPropVal("type");
                      if (P === C.d && w === _ && S === x) ++f;
                      else if (k.getPropVal("nest_level") < _ || S !== x) break;
                      m = y.pos - 1;
                    }
                    for (var I = a; ; ) {
                      var E = n.getPapx(I),
                        R = E.prop,
                        N = R.getPropVal("para_type"),
                        A = R.getPropVal("nest_level"),
                        L = R.getPropVal("type");
                      if (N === C.d && A === _ && L === x) ++f;
                      else if (R.getPropVal("nest_level") < _ || L !== x) break;
                      I = E.pos + E.len;
                    }
                    t.tableRowCnt = f;
                  }
                  (t.cells = []),
                    (t.idxs = []),
                    (t.rows = []),
                    (t.wholeCellSelected = !0);
                  for (var D = 0; D < h.length; ++D)
                    t.cells.push(h[D].cells),
                      t.idxs.push(h[D].idxs),
                      t.rows.push(h[D].row),
                      h[D].wholeCellSelected ||
                        ((t.columnSelected = !1), (t.wholeCellSelected = !1));
                  if (
                    ((t.rowCnt = h.length),
                    (t.columnCnt = h[0].idxs.length),
                    t.rowSelected)
                  ) {
                    (t.leftRects = []),
                      h.forEach(function (n) {
                        if (n.cells && n.cells.length) {
                          var o = e._getRelativeLine(n.cells[0].begin, 1);
                          if (o) {
                            var a = o.tablecells[0],
                              s = o.viewPage.outer_rect,
                              r = i
                                ? F.default.transvertPositionFromNode2Target(
                                    o,
                                    o.viewPage
                                  )
                                : F.default.getPosition2view(o),
                              l = {
                                left:
                                  (i
                                    ? F.default.transvertPositionFromNode2Target(
                                        a,
                                        a.viewPage
                                      )
                                    : F.default.getPosition2view(a)
                                  ).x + s.left,
                                top: r.y + s.top,
                                width: a.rect.width,
                                height: a.rect.height,
                              };
                            t.leftRects.push(l);
                          }
                        }
                      });
                  } else if (t.columnSelected) {
                    var M = this._getRelativeLine(a, 1);
                    if (M) {
                      t.topRects = [];
                      var O = M.tablecells,
                        U = M.viewPage.outer_rect,
                        B = i
                          ? F.default.transvertPositionFromNode2Target(
                              M,
                              M.viewPage
                            )
                          : F.default.getPosition2view(M);
                      t.idxs[0].forEach(function (e) {
                        if (e < O.length) {
                          var n = M.tablecells[e],
                            o = {
                              left:
                                (i
                                  ? F.default.transvertPositionFromNode2Target(
                                      n,
                                      n.viewPage
                                    )
                                  : F.default.getPosition2view(n)
                                ).x + U.left,
                              top: B.y + U.top,
                              width: n.rect.width,
                              height: n.rect.height,
                            };
                          t.topRects.push(o);
                        }
                      });
                    }
                  }
                  return (
                    (t.cellsSelected =
                      t.columnSelected ||
                      t.rowSelected ||
                      t.wholeCellSelected ||
                      t.tableSelected),
                    t
                  );
                },
              },
              {
                key: "getSelectionInfo",
                value: function () {
                  var e = this.selection.getNormalRange(),
                    t = window.APP,
                    n = t.formatContentController,
                    i = t.restrictEditHandler,
                    o = n.checkIsEditable(),
                    a = o.allowInsert,
                    s = o.allowDelete,
                    r = o.allowComment,
                    l = o.allowFormat,
                    c = o.allowInsertBookmark,
                    h = o.allowInsertDatetime,
                    d = o.allowInsertPic,
                    p = o.hasEditPermission,
                    g = n.checkIsIncludeUnEditable(e.pos, e.len);
                  (this.info.isNonEditableInRestrictedMode =
                    i.checkIsRangeNonEditable(e)),
                    (this.info.isIncludeUnEditableControl = g),
                    (this.info.isAllowInsertWithControl = a),
                    (this.info.isAllowDeleteWithControl = s),
                    (this.info.isAllowCommentWithControl = r),
                    (this.info.isAllowFormatWithControl = l),
                    (this.info.isAllowInsertPicWithControl = d),
                    (this.info.isAllowInsertDatetimeWithControl = h),
                    (this.info.isAllowInsertBookmarkWithControl = c),
                    (this.info.hasEditPermissionWithControl = p),
                    (this.info.isOutOfEditableArea =
                      i.isInFormProtectMode &&
                      !n.checkIsInContentControl() &&
                      this.isSelOutTextFormField());
                  var f = this.data.doc.textboxs;
                  (this.info.isInTextbox = !!f.isInTextbox(this.info.begin)),
                    (this.info.textbox = f.findBodyRange(this.info.begin)),
                    (this.info.isTextboxSelected =
                      this.info.end - this.info.begin == 1 &&
                      !!this.info.textbox),
                    (this.info.inOMath = this.selection.inOMath);
                  var C = this.selection.selContext;
                  (this.info.isInHeaderFooter = C.isInHeaderFooter),
                    (this.info.isInComment = C.isInComment()),
                    (this.info.controlInfo = this.isHitOnCtrl()),
                    (this.info.isInFootnoteOrEndnote = C.isInFootnoteOrEndnote);
                  var v = window.APP.isReadOnly();
                  if (
                    ((this.info.isPapxNonEditable =
                      v || i.checkIsAnyPapxNonEditable()),
                    (this.info.isSelectionRangeNonEditable =
                      !this.info.isInComment &&
                      (v || this.info.isNonEditableInRestrictedMode)),
                    !window.APP.isWebMode() &&
                      !u.isMobile &&
                      (this.info.isInTextbox || this.info.isTextboxSelected))
                  ) {
                    var _ = this.info.isInTextbox
                      ? this.selection.begin.pos
                      : this.data.typoinfo.getPosition(this.info.textbox.pos)
                          .pos;
                    if (_ && _.line && _.line.scene.textbox_page) {
                      var x = _.line.scene.textbox_page.textflow.corX;
                      this.info.isTextboxLRTextflow =
                        "L2R" === x || "R2L" === x;
                    }
                  }
                  var T = this.data.doc.getDataLogic("final"),
                    b = T.specTable,
                    m = T.collectPapxs(e.pos, e.len);
                  return (
                    (this.info.containsTableTextFrame =
                      !!b.collectTapxs(e.pos, e.len).find(function (e) {
                        return e && e.prop && e.prop.text_frame;
                      }) ||
                      !!m.find(function (e) {
                        return e && e.prop && e.prop.text_frame;
                      })),
                    (this.info.isInReadonlyDocumentField =
                      this.checkIsSelInReadOnlyDocumentField()),
                    (this.info.isCellsContinuous = this.isSelectedContinuous()),
                    (this.info.isSelEqZone = this.isSelEqZone()),
                    this.assignIsAllowInsertRepeatControl(m, e),
                    (this.info.selectMulPapxs = m.length > 1),
                    this.info
                  );
                },
              },
              {
                key: "assignIsAllowInsertRepeatControl",
                value: function (e, t) {
                  var n = t.pos,
                    i = t.len,
                    o = e && e[0],
                    a = e && e[e.length - 1];
                  if (o && a)
                    if (n !== o.pos || n + i !== a.pos + a.len) {
                      var s = this.data.doc.getText(o.pos, n - o.pos),
                        r = this.data.doc.getText(n + i, a.pos + a.len - n - i),
                        l = s.concat(r),
                        c = !0;
                      if (l)
                        for (var h = 0; h < l.length; ++h) {
                          var d = l.charCodeAt(h);
                          d !== _.Return &&
                            d !== _.EndPara &&
                            d !== _.Comment &&
                            d !== _.ControlBegin &&
                            d !== _.ControlEnd &&
                            (c = !1);
                        }
                      !c ||
                      (this.info.inTable &&
                        !this.info.rowSelected &&
                        this.info.cells &&
                        (1 !== this.info.columnCnt || 1 !== this.info.rowCnt))
                        ? (this.info.isAllowInsertRepeatSecCtrl = !1)
                        : this.checkPapxIsAllowInsertControl(e, t);
                    } else
                      (this.info.isAllowInsertRepeatSecCtrl = !0),
                        this.checkPapxIsAllowInsertControl(e, t);
                },
              },
              {
                key: "checkPapxIsAllowInsertControl",
                value: function (e, t) {
                  for (
                    var n = !1,
                      i = !1,
                      o = !0,
                      a = 0,
                      s = 0,
                      r = t.pos,
                      l = t.len,
                      c = 0;
                    c < e.length;
                    c++
                  ) {
                    var h = e[c];
                    if (h.prop.nest_level) {
                      if (((n = !0), h.pos > a && h.pos < s)) continue;
                      var d =
                          window.APP.data.selection.getTableRange(h.pos) || {},
                        p = d.begin,
                        u = d.end;
                      (a = p), (s = u), (p < r || u > r + l) && (o = !1);
                    } else i = !0;
                    if (!o && i) break;
                  }
                  n && i && !o
                    ? ((this.info.isAllowInsertRepeatSecCtrl = !1),
                      (this.info.forbidInsertControl = !0))
                    : (this.info.isAllowInsertRepeatSecCtrl = !0);
                },
              },
              {
                key: "getTrackArea",
                value: function () {
                  var e = this.getSelectionInfo(),
                    t = e.containDrawing,
                    n = e.begin,
                    i = e.end,
                    o = e.cellsSelected,
                    a = e.tableSelected,
                    s = e.inTable,
                    r = e.isPoint,
                    l = "text";
                  return (
                    (s && r) || a || o
                      ? (l = "table")
                      : t && i - n < 3 && (l = "object"),
                    l
                  );
                },
              },
              {
                key: "isSelectedContinuous",
                value: function () {
                  var e = this.info,
                    t = e.rowSelected,
                    n = void 0 !== t && t,
                    i = e.tableSelected,
                    o = void 0 !== i && i,
                    a = e.idxs,
                    s = void 0 === a ? [] : a,
                    r = e.cells,
                    l = void 0 === r ? [] : r,
                    c = e.inTable,
                    h = n && !o;
                  if (!(void 0 !== c && c) || s.length * l.length == 0)
                    return !1;
                  var d = !0;
                  return (
                    s.some(function (e) {
                      var t = e.length;
                      if (!(e[t - 1] - e[0] + 1 === t)) return (d = !1), !0;
                    }),
                    h &&
                      l.some(function (e, t) {
                        if (0 === t) return !1;
                        var n = l[t - 1],
                          i = n[n.length - 1];
                        return e[0].begin - i.end != 1
                          ? ((d = !1), !0)
                          : void 0;
                      }),
                    d
                  );
                },
              },
              {
                key: "getCellPageRect",
                value: function () {
                  var e = this._info,
                    t = e.begin,
                    n = e.end,
                    i = e.idxs;
                  if (this._isInTable(t, n) && i) {
                    var o = this.data.selection.begin.pos.line,
                      a = o && (o.isSubLine ? o.parent.parent : o.parent);
                    return { rect: a && a.rect };
                  }
                },
              },
              {
                key: "info",
                get: function () {
                  return (
                    this._info ||
                      ((this._info = this.getAreaInfo()),
                      this.getSelectionInfo()),
                    this._info
                  );
                },
                set: function (e) {
                  this._info = e;
                },
              },
            ]),
            e
          );
        })();
      t.default = ae;
    },
    1709: function (e, t, n) {
      "use strict";
      n.r(t),
        n.d(t, "UnitType", function () {
          return l;
        }),
        n.d(t, "UnitName", function () {
          return c;
        }),
        n.d(t, "UnitCNName", function () {
          return h;
        }),
        n.d(t, "UnitI18nName", function () {
          return d;
        });
      var i = n(1),
        o = n.n(i),
        a = n(2),
        s = n.n(a),
        r = n(231),
        l = {
          Unit_pt: 0,
          Unit_inc: 1,
          Unit_cm: 2,
          Unit_mm: 3,
          Unit_ref: 4,
          Unit_ti: 5,
        },
        c = ["pt", "inc", "cm", "mm", "ref", "ti"],
        h = ["磅", "英寸", "厘米", "毫米", "?", "缇"],
        d = function (e, t) {
          switch (e.toUpperCase()) {
            case "EN-US":
              return ["pt", "inc", "cm", "mm", "ref", "ti"][t];
            case "AR":
              return ["الرطل", "بوصة", "سم", "مم", "الصفوف", "ti"][t];
            case "TH":
              return ["ปอนด์", "นิ้ว", "ซม.", "มม.", "แถว", "สีส้มอมแดง"][t];
            default:
              return ["磅", "英寸", "厘米", "毫米", "?", "缇"][t];
          }
        },
        p = (function () {
          function e(t, n) {
            o()(this, e), (this.val = t), (this.unit = n);
          }
          return (
            s()(
              e,
              [
                {
                  key: "ti",
                  get: function () {
                    return Object(r.convertUnit)(
                      this.val,
                      c[this.unit],
                      c[l.Unit_ti]
                    );
                  },
                },
                {
                  key: "pt",
                  get: function () {
                    return Object(r.convertUnit)(
                      this.val,
                      c[this.unit],
                      c[l.Unit_pt]
                    );
                  },
                },
                {
                  key: "inc",
                  get: function () {
                    return Object(r.convertUnit)(
                      this.val,
                      c[this.unit],
                      c[l.Unit_inc]
                    );
                  },
                },
                {
                  key: "cm",
                  get: function () {
                    return Object(r.convertUnit)(
                      this.val,
                      c[this.unit],
                      c[l.Unit_cm]
                    );
                  },
                },
                {
                  key: "mm",
                  get: function () {
                    return Object(r.convertUnit)(
                      this.val,
                      c[this.unit],
                      c[l.Unit_mm]
                    );
                  },
                },
              ],
              [
                {
                  key: "init",
                  value: function (t, n) {
                    return new e(t, n);
                  },
                },
              ]
            ),
            e
          );
        })();
      t.default = p;
    },
    5790: function (e, t, n) {
      "use strict";
      n.r(t),
        n.d(t, "Auto", function () {
          return i;
        }),
        n.d(t, "Top", function () {
          return o;
        }),
        n.d(t, "Center", function () {
          return a;
        }),
        n.d(t, "Bottom", function () {
          return s;
        }),
        n.d(t, "BaseLine", function () {
          return r;
        });
      var i = 0,
        o = 1,
        a = 2,
        s = 3,
        r = 4;
    },
    6801: function (e, t, n) {
      "use strict";
      n.d(t, "a", function () {
        return i;
      }),
        n.d(t, "b", function () {
          return o;
        });
      var i = 0,
        o = 1;
    },
  },
]);
